package Entity;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;

import VOs.QuoteVO;

@Entity
public class Quote {

	@Id
	private long id;
	private double low;
	private double high;
	private double open;
	private double close;
	private double volume;
	@ManyToOne
	private Stock stock;
	@OneToOne
	private Date date;
	
	public QuoteVO tovo(){
		QuoteVO vo = new QuoteVO();
		vo.setClose(getClose());
		vo.setHigh(getHigh());
		vo.setId(getId());
		vo.setLow(getLow());
		vo.setOpen(getOpen());
		vo.setVolume(getVolume());
		vo.setDate(getDate());
		vo.setStock(getStoke());
		
		return vo;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public double getLow() {
		return low;
	}

	public void setLow(double low) {
		this.low = low;
	}

	public double getHigh() {
		return high;
	}

	public void setHigh(double high) {
		this.high = high;
	}

	public double getOpen() {
		return open;
	}

	public void setOpen(double open) {
		this.open = open;
	}

	public double getClose() {
		return close;
	}

	public void setClose(double close) {
		this.close = close;
	}

	public double getVolume() {
		return volume;
	}

	public void setVolume(double volume) {
		this.volume = volume;
	}

	public Stock getStoke() {
		return stock;
	}

	public void setStoke(Stock stock) {
		this.stock = stock;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

}
